
function keyLogin(){
    if (event.keyCode==13)  //回车键的键值为13
        document.getElementById("denglu").click(); //调用登录按钮的登录事件
}
function checkUserSecret(){
    var name=document.getElementById("username").value;
    var password=document.getElementById("password").value;
    ajaxCall("POST",path+"/BoolServlet?method=boolUserSecret&name="+name+"&password="+password,skipPage);
    return false;
}
function skipPage(response){
    var obj=JSON.parse(response);
    if("teacher"==obj){
        window.location.href = path+"/jsp/Tmain.jsp";
        return;
    }else if("false"==obj) {
        alert("用户名或密码错误！");
        window.location.href = path+"/login.jsp";
    }else if("student"==obj){
        window.location.href = path+"/jsp/Smain.jsp";
        return;
    }
}